import 'package:flutter/material.dart';
import 'package:mall/components/product_list.dart';

class ProductAreaScreenArgs {
  final String name;
  final int storeId;
  final int categoryId;
  final int areaId;

  ProductAreaScreenArgs({
    this.name,
    this.storeId,
    this.categoryId,
    this.areaId,
  });
}

/// 普通商区
class ProductAreaScreen extends StatefulWidget {
  static const routeName = "/ProductAreaScreen";
  final ProductAreaScreenArgs args;

  const ProductAreaScreen({
    Key key,
    @required this.args,
  }) : super(key: key);

  @override
  _ProductAreaScreenState createState() => _ProductAreaScreenState();
}

class _ProductAreaScreenState extends State<ProductAreaScreen> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("${widget.args.name}"),
      ),
      body: ProductList(
        storeId: widget.args.storeId,
        categoryId: widget.args.categoryId,
        areaId: widget.args.areaId,
      ),
    );
  }
}
